package com.sbl.bajw.util;

import java.util.List;

import org.apache.poi.ss.formula.functions.T;

public class JsonResultUtil {

	public static String Error(String msg){
		String result = Success(msg,"");
		return result;
	}
	
	public static String Success(String data){
		String result = Success("成功",data);
		return result;
	}
	
	public static String Success(){
		String result = Success("成功","\"\"");
		return result;
	}
	
	public static String Success(String msg, List<T> list){
		String str = JsonUtil.ConvertArrayToJson(list);
		String result = Success(msg, str);
		return result;
	}
	
	public static String Success(String msg, String data){
		String json = "{\"code\":\"1\",";
		json += "\"msg\":\"" + msg + "\",";
		json += "\"success\":\"true\",";
		json += "\"data\":" + data + "}";
		return json;
	}
}
